export function viewReport(reportName, params) {
    // 拿到环境变量中的VITE_ADMIN_PROXY_IP
    let href = import.meta.env.VITE_ADMIN_PROXY_IP + '/ureport/preview?';
    // let href = 'http://10.1.7.105:18081/ureport/preview?';
    // let href = 'http://localhost:18081/ureport/preview?';
    const filterArr: any = [];
    // btns = btns && btns.length > 1 ? btns : [1, 2, 3, 4, 5, 6, 7, 8, 9]
    // filterArr.push("_t=" + btns.join(','));
    filterArr.push('_u=mysql:' + reportName + '.ureport.xml')
    filterArr.push('n=' + reportName);
    for (let key in params) {
        filterArr.push(params[key] ? (key + "=" + params[key]) : "");
    }

    window.open(href + filterArr.join("&"), '_blank');
}

export function testViewReportUrl() {
    console.log(import.meta.env.VITE_ADMIN_PROXY_IP + ':18081/ureport/preview');
}